<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateParishesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('parishes', function (Blueprint $table) {
            $table->id();
            $table->string('title',50);
            $table->integer('admin_user_id')->default(0)->comment('录入人id');
            $table->string('thumb')->default('')->comment('缩略图');
            $table->string('province_adcode',6)->nullable()->default(null)->comment('省级行政区划编码');
            $table->string('city_adcode',6)->nullable()->default(null)->comment('市级行政区划编码');
            $table->string('district_adcode',6)->nullable()->default(null)->comment('区级行政区划编码');
            $table->string('province',50)->nullable()->default(null)->comment('省');
            $table->string('city',50)->nullable()->default(null)->comment('市');
            $table->string('district',50)->nullable()->default(null)->comment('区/县');
            $table->string('address',50)->nullable()->default(null)->comment('详细地址');
            $table->decimal('lng',10,6)->default(0)->comment('经度');
            $table->decimal('lat',10,6)->default(0)->comment('纬度');
            $table->mediumText('content')->comment('内容详情');
            $table->tinyInteger('status')->default(1)->comment('是否显示');
            //弥撒时间 类型 堂区联系人
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('parishes');
    }
}
